home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-07 | 1.8 KB | 75 lines | [TEXT/MPS ] |
- (*
- CTBTool([type]) -- Return the current tool for the type of tool indicated ("connection" (default),
- "terminal", or "file transfer").
-
- To compile and link this file using Macintosh Programmer's Workshop,
-
- pascal -w CTBTool.p
- link -m ENTRYPOINT -o HyperCommands -rt XFCN=2755 -sn Main=CTBTool ∂
- CTBTool.p.o "{MPW}"Libraries:interface.o "{MPW}"Libraries:Libraries:HyperXLib.o
-
- © Copyright 1990 by Apple Computer, Inc.
-
- Initial coding 2/90 by Harry R. Chesley.
- *)
-
- {$R-}
-
- {$S CTBTool } { Segment name must be the same as the command name. }
-
- unit DummyUnit;
-
- interface
-
- uses MemTypes, QuickDraw, OSIntf, ToolIntf, CTBUtils, FTIntf, CMIntf, TMIntf, CRMIntf, HyperXCmd;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- implementation
-
- procedure CTBTool(paramPtr: XCmdPtr); forward;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- begin
- CTBTool(paramPtr);
- end;
-
- procedure CTBTool(paramPtr: XCmdPtr);
-
- {$I CTBUtil.inc}
-
- var tt: ToolType;
- s: Str255;
-
- procedure Fail(errMsg: Str255); { set theResult and quit }
- begin
- paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
- exit(CTBTool);
- end;
-
- begin
- { Check the parameter count. }
- if paramPtr^.paramCount > 1 then Fail('Invalid parameter count');
-
- { Figure out what kind of tool we want info on. }
- if not ParmPresent(1) then tt := connectionTool
- else tt := GetToolTypeParm(1);
-
- { Make sure the Comm Toolbox is here. }
- CTBReady;
-
- { Get the tool name string. }
- s := '';
- case tt of
- connectionTool: if Globals^^.connHand <> nil then CMGetToolName(Globals^^.connHand^^.procID,s);
- terminalTool: if Globals^^.termHand <> nil then TMGetToolName(Globals^^.termHand^^.procID,s);
- fileTransferTool: if Globals^^.FTHand <> nil then FTGetToolName(Globals^^.FTHand^^.procID,s);
- end;
-
- { Return it. }
- if s <> '' then paramPtr^.returnValue := PasToZero(paramPtr,s)
- end;
-
- end.
-